<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @fileOverview 검색결과보기의 최상위 컨트롤러
<span class='line'>  3</span>  * @author dioong
<span class='line'>  4</span>  */</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="NAME">nhn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.nhn</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="NAME">nhn.newsstand.search</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.search</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  8</span> </span><span class="NAME">nhn.newsstand.search.Controller</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Class</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">	</span><span class="COMM">/** @lends nhn.newsstand.search.Controller.prototype */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 12</span> 	 * nhn.newsstand.search.Controller 클래스의 인스턴스를 생성한다.  
<span class='line'> 13</span> 	 * @constructs
<span class='line'> 14</span> 	 * @class 검색결과보기의 최상위 컨트롤러
<span class='line'> 15</span> 	 * &lt;br/>- RSS 주소 복사 클립보드 생성
<span class='line'> 16</span> 	 * @extends nhn.newsstand.common.AbstractController
<span class='line'> 17</span> 	 * @requires jindo.Clipboard
<span class='line'> 18</span> 	 * @requires nhn.newsstand.common.page.ViewEventController
<span class='line'> 19</span> 	 * @requires nhn.newsstand.common.ContentDisplayCountAdjuster
<span class='line'> 20</span> 	 * @requires nhn.newsstand.search.AjaxHistoryController
<span class='line'> 21</span> 	 * @requires nhn.newsstand.search.ArticleListController
<span class='line'> 22</span> 	 * @requires nhn.newsstand.search.SearchOptionUIController
<span class='line'> 23</span> 	 * @param {String} sQuery 검색어
<span class='line'> 24</span> 	 * @example
<span class='line'> 25</span> 	 * var oController = new nhn.newsstand.search.Controller("검색어");
<span class='line'> 26</span> 	 */</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">	</span><span class="NAME">$init</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sQuery</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elcontainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'container'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">REQ_PAGE_SIZE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">24</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">		</span><span class="COMM">/*
<span class='line'> 31</span> 		 * 검색결과 기본 옵션
<span class='line'> 32</span> 		 * period=INPUT&query=a&stOffices=00020|00028&stGenres=00101|00102&stEntities=00100|00200&stPages=1&stPageSections=00020|00030&startDate=20100701&endDate=20100831
<span class='line'> 33</span> 		 * */</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">htInitOption</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">				 </span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">			</span><span class="NAME">query</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">sQuery</span><span class="PUNC">,</span><span class="WHIT">					</span><span class="COMM">//query</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">			</span><span class="NAME">pageSize</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">REQ_PAGE_SIZE</span><span class="PUNC">,</span><span class="WHIT">	</span><span class="COMM">//페이지당 list갯수</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">			</span><span class="NAME">page</span><span class="WHIT"> 		</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">				</span><span class="COMM">//시작 페이지</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">			</span><span class="NAME">orderBy</span><span class="WHIT">		</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"rel.dsc"</span><span class="PUNC">,</span><span class="WHIT">		</span><span class="COMM">//정렬</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">			</span><span class="NAME">period</span><span class="WHIT"> 		</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ALL"</span><span class="PUNC">,</span><span class="WHIT">			</span><span class="COMM">//기간</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">			</span><span class="NAME">sm</span><span class="WHIT"> 			</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"all.basic"</span><span class="PUNC">,</span><span class="WHIT">		</span><span class="COMM">//영역 	</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">			</span><span class="NAME">stPages</span><span class="WHIT">		</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ALL"</span><span class="PUNC">,</span><span class="WHIT">				</span><span class="COMM">//지면  </span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">			</span><span class="NAME">stOffices</span><span class="WHIT"> 	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ALL"</span><span class="PUNC">,</span><span class="WHIT">				</span><span class="COMM">//언론사 </span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">			</span><span class="NAME">stSections</span><span class="WHIT">	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ALL"</span><span class="PUNC">,</span><span class="WHIT">				</span><span class="COMM">//주제(기사section)			</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">			</span><span class="NAME">stGenres</span><span class="WHIT">   	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ALL"</span><span class="PUNC">,</span><span class="WHIT">				</span><span class="COMM">//장르 유형  (기사 하위)</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">			</span><span class="NAME">stEntities</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ALL"</span><span class="PUNC">,</span><span class="WHIT">				</span><span class="COMM">//엔터티 목록 (유형 하위)</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">			</span><span class="NAME">hl</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">encodeURIComponent</span><span class="PUNC">(</span><span class="STRN">"all.&lt;em class=\"mark\">.&lt;/em>"</span><span class="PUNC">)</span><span class="WHIT">	</span><span class="COMM">//highlight method</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"ajaxHistory"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.search.AjaxHistoryController</span><span class="PUNC">(</span><span class="NAME">htInitOption</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="COMM">//Ajax 히스토리</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"viewEvent"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.common.page.ViewEventController</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">			</span><span class="NAME">ITEM_PER_PAGE</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">REQ_PAGE_SIZE</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">			</span><span class="NAME">displayAdjuster</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.common.ContentDisplayCountAdjuster</span><span class="PUNC">(</span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">".press_lst ul.sc"</span><span class="PUNC">,</span><span class="NAME">elcontainer</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"articleList"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.search.ArticleListController</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> 			</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">			</span><span class="NAME">container</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">elcontainer</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"searchOption"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.search.SearchOptionUIController</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">			</span><span class="NAME">elSearchOptionContainer</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">"div.snb > div.sub_left"</span><span class="PUNC">,</span><span class="NAME">elcontainer</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">			</span><span class="NAME">initOptions</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">htInitOption</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">		</span><span class="NAME">this._initClipboardComponent</span><span class="PUNC">(</span><span class="NAME">elcontainer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">		</span><span class="COMM">//클립보드 콤포넌트</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 67</span> 	 * RSS복사 기능을 위한 클립보드 콤포넌트 초기화
<span class='line'> 68</span> 	 * @param {HTMLElement} elcontainer rss버튼 상위 element
<span class='line'> 69</span> 	 */</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">	</span><span class="NAME">_initClipboardComponent</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elcontainer</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._oClipboard</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">		</span><span class="NAME">this._oClipboard</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jindo.Clipboard</span><span class="PUNC">(</span><span class="STRN">'/js/libs/clipboard.swf'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attach</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">			</span><span class="NAME">load</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nDomain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"naver.com"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nDomainLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nDomain.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sSubDomain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">location.href.slice</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">location.href.indexOf</span><span class="PUNC">(</span><span class="NAME">nDomain</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="NAME">nDomainLength</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">				</span><span class="NAME">this.setData</span><span class="PUNC">(</span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">"a.rss"</span><span class="PUNC">,</span><span class="NAME">elcontainer</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sSubDomain</span><span class="PUNC">+</span><span class="STRN">"/rss/search/"</span><span class="PUNC">+</span><span class="NAME">sQuery</span><span class="PUNC">+</span><span class="STRN">"/articles.rss"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">			</span><span class="NAME">copy</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">				</span><span class="NAME">clickcr</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.element</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"sfr.rss"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'1'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">		</span><span class="COMM">//nclick&clickcr 5번째 인자에 event객체 안 넘김, 넘길 수 있는 방법 없음.</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">				</span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"클립보드에 RSS 주소가 복사되었습니다. \n RSS 리더기에 붙여넣기(Ctrl+V)하세요."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">			</span><span class="NAME">over</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">			</span><span class="NAME">out</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">extend</span><span class="PUNC">(</span><span class="NAME">nhn.newsstand.common.AbstractController</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>